<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"> 
<head>
	<!-- INCLUDE meta.html -->
    
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<div class='main'>

<div class="headerdiv">
	<!-- INCLUDE header.html -->
</div>

<div id='content'>
	<div id='left'>
    	<div style="margin:10px;margin-top:30px;">
        	<ul>

            </ul>
    		
        </div>
    </div>
    <div id='maindiv'>
    	<div class="description">
			{page_description}
        </div>
        
        <!-- IF err_msg -->
        <div class="err_msg pad">
        	{err_msg}
        </div>
        <!-- ENDIF -->
        
        <!-- IF success_msg -->
        <div class="success_msg pad">
        	{success_msg}
        </div>
        <!-- ENDIF -->
        
        <div class="real_content">
        
        
        
       	<table>

            	<tr>
                	<td>{USER_NAME}</td>
                	<td>{user.name}</td>
               	</tr>
                
                <tr>
                	<td valign="top">{HEADS}</td>
                	<td>
					<table border="0" >
						<tr>
							<td valign="top">
                    			<!-- IF user.small_head --><a href="javascript:;" onclick="show_big_head()"><img align="left" border="0" src="{user.small_head}" class="head" id="small_head" /></a><!-- ENDIF -->
                    		</td>
							<td valign="top">
                    <div style="display:none;background-color:#ffff99;width:350px;padding:9px;" id="upload_head_div">
                    <h2>{UPLOAD_HEAD}</h2>
                    <form action="admin.php?p=account&m=upload" target="upload_iframe" method="post" enctype="multipart/form-data" >
                    <input type="file" style="width:220px;" name="photoupload" />&nbsp;&nbsp;<input type="submit" value="{UPLOAD}" />&nbsp;<br /><input type="button" onclick="cancel_upload();return false;" value="{CANCEL}" />
                    </form>
                    </div>
                    <input type="button" id="modify_btn" value="{MODIFY_HEAD}" onclick="return upload_head();" />
							</td>
						</tr>
						</table>
                   	</td>
               	</tr>
           </table>
           
          <form action="admin.php?m=edit&p=account" method="post" onsubmit="return false;" >
              <table>
              	<tr>
                	<td valign="top">{USER_NICKNAME}</td>
                    <td><input type="text" class="inputtext" maxlength=200 name="nickname" id='nick' value="{user.nickname}" /></td>
                    </tr>
                <tr>
                	<td valign="top">{USER_PASSWORD}</td>
                    <td><input type="password" class="inputtext" maxlength=200 name="password" id='password' />{IF_NOT_CHANGE}</td>
                </tr>
          
                <tr>
                	<td valign="top">{USER_PASSWORD_CONFIRM}</td>
                    <td><input type="password" class="inputtext" maxlength=200 name="password2" id='password2' />{IF_NOT_CHANGE}</td>
                </tr>
            	<tr>
                	<td>{EMAIL}</td>
                	<td><input type="text" class="inputtext" maxlength=200 name="email" value="{user.email}" /></td>
               	</tr> 
                <tr>
                	<td>{PROFILE_PAGE}</td>
                	<td><input type="text" class="inputtext" maxlength=200 name="profile_page" value="{user.profile_page}" />{PROFILE_PAGE_HELP}</td>
               	</tr>
				<tr>
                	<td valign="top">{RESUME}</td>
                	<td>
					<?php
					$oFCKeditor = new FCKeditor('resume') ;
					$oFCKeditor->BasePath	= 'lz_system/plugin/fckeditor/' ;
					$oFCKeditor->Value		= $_obj['user']['resume'];
					$oFCKeditor->Height = 200;
					$oFCKeditor->Create();

	                    ?>
					</td>
               	</tr>                     
                <tr>
                	<td colspan="2" align="center"><input type="submit" value="{USER_SUBMIT}" onclick="check_form(); return false;" />&nbsp;&nbsp;<span  style="background-color:#ffff99;padding:3px;display:none" id='notice_span'>{CHANGES_SAVED}</span></td>
                </tr>
             </table>
             
                
           </form>

			<script>
			var big_head = '{user.big_head}';
			function show_big_head()
			{
				preview(big_head);
			}
			
			function check_form()
			{
				
				if ($_('password').value != $_('password2').value)
				{
					alert('{PASSWORD_NOT_THE_SAME}');
					return false;
				}
				commit_form();
				return false;
			}
			
			function commit_form()
			{
				$('[type=submit]').attr('disabled','disabled');
				$.post('admin.php?p=account&m=edit',{
					nickname: $('[name=nickname]').val(),
					email: $('[name=email]').val(),
					password: $('[name=password]').val(),
					'profile_page': $('[name=profile_page]').val(),
					resume:FCKeditorAPI.GetInstance('resume').GetHTML()
				}, submit_callback);
			}
			
			function submit_callback(s)
			{
				$('#notice_span').html(s).fadeIn('fast');
				$('[type=submit]').removeAttr('disabled');
				setTimeout("$('#notice_span').fadeOut('slow');",5000);
			}
			
			function upload_head()
			{
				if ($('#upload_iframe').length <= 0)
				{
					var iframe = document.createElement('iframe');
					$(iframe).css('display','none').attr('id','upload_iframe').attr('name','upload_iframe');
					$(document.body).append(iframe);
				}
				$('#modify_btn').fadeOut(100);
				$('#upload_head_div').fadeTo(10,0).slideDown('fast').fadeTo(100,1);
				return false;
			}
			
			function cancel_upload()
			{
				$('#upload_head_div').fadeTo(100,0).slideUp('fast',function()
				{
					$('#modify_btn').fadeIn(100);
				});
				
			}
			
			function refresh_head()
			{
				cancel_upload();
				$.post('admin.php?p=account&m=get_user',{  },refresh_head_callback,'JSON');
			}
			function refresh_head_callback(s)
			{
				try
				{
					eval('arr = '+s);
						
					window.big_head = arr.big_head;
					
					$('#small_head').fadeTo(100,0.2);
					var img2 = new Image();
					$(img2).bind('load',function()
						{
							$('#small_head').attr('src',$(this).attr('src')).fadeTo(100,1);
						}).attr('src',arr.small_head);
				}catch(e) { }
			}
			</script>

        </div>
        
    </div>
</div>


<!-- INCLUDE footer.html -->

</div>
</body>
</html>